//
//  BCUserSvipHeaderNotBuyView.m
//  GSBlockChain
//
//  Created by guoshikeji_a on 2018/12/20.
//  Copyright © 2018 guoshikeji. All rights reserved.
//

#import "BCUserSvipHeaderNotBuyView.h"

#import "BCUserSvipResponse.h"

@interface BCUserSvipHeaderNotBuyView ()

@end

@implementation BCUserSvipHeaderNotBuyView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self setupSubviews];
    }
    return self;
}

- (void)setupSubviews {
    self.buyButton = [QMUIButton new];
    self.buyButton.backgroundColor = [UIColor darkMainColor];
    self.buyButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
    [self.buyButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self addSubview:self.buyButton];
    [self.buyButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self).offset(-30.0);
        make.centerX.mas_equalTo(self);
        make.width.mas_equalTo(self).offset(-40.0);
        make.height.mas_equalTo(44.0);
    }];
    self.buyButton.layer.cornerRadius = 4;
    //
    self.alertLabel = [QMUILabel new];
    self.alertLabel.textAlignment = NSTextAlignmentCenter;
    self.alertLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
    self.alertLabel.textColor = [UIColor qmui_colorWithHexString:@"#292C37"];
    self.alertLabel.numberOfLines = 0;
    [self addSubview:self.alertLabel];
    [self.alertLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.width.mas_equalTo(self).multipliedBy(.65);
        make.bottom.mas_equalTo(self.buyButton.mas_top).offset(-22.0);
    }];
}

- (void)setSvipData:(BCUserSvipData *)svipData {
    _svipData = svipData;
    //
    self.alertLabel.text = svipData.flow.text;
    [self.buyButton setTitle:svipData.flow.not_buy forState:UIControlStateNormal];
}

@end
